package com.tdx.blog_nowcoder.config;

import org.elasticsearch.client.RequestOptions;
import org.springframework.context.annotation.Configuration;


/**
* @description: TODO
* @author tdx
* @date 2022/7/7 20:18
* @version 1.0
*/


//@Configuration
public class ElasticConfig {
    public static final RequestOptions COMMON_OPTIONS;
    static {
        RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder();
        COMMON_OPTIONS = builder.build();
    }

    /**
     * 不使用默认配置路径信息，可以使用以下自定义
     * localhost:9200 写在配置文件中就可以了
     * @return
     */
//    @Bean
//    public RestHighLevelClient client() {
//        ClientConfiguration clientConfiguration = ClientConfiguration.builder()
//                .connectedTo(elasticsearchUrl)
//                .build();
//
//        return RestClients.create(clientConfiguration).rest();


}
